﻿//
// Created: 2018/8/14
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.Admin;

namespace Model.Admin.Map
{
    internal  class AdminMenuMap:EntityTypeConfiguration< AdminMenu >    
    {
        public AdminMenuMap()
        {
             this.ToTable("Admin_Menu");
             this.HasKey(i => new { i.ID });
             this.Property(i => i.ID).HasColumnName("ID");                     
             this.Property(i => i.MenuId).HasColumnName("MenuId");                     
             this.Property(i => i.MenuName).HasColumnName("MenuName");                     
             this.Property(i => i.MenuDesc).HasColumnName("MenuDesc");                     
             this.Property(i => i.MenuUrl).HasColumnName("MenuUrl");                     
             this.Property(i => i.MenuParentId).HasColumnName("MenuParentId");                     
             this.Property(i => i.MenuOrder).HasColumnName("MenuOrder");                     
             this.Property(i => i.MenuIcon).HasColumnName("MenuIcon");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.Creator).HasColumnName("Creator");                     
             this.Property(i => i.UpdateTime).HasColumnName("UpdateTime");                     
             this.Property(i => i.Updator).HasColumnName("Updator");                     
             this.Property(i => i.Enable).HasColumnName("Enable");                     
             this.Property(i => i.Site).HasColumnName("Site");                     
             this.Property(i => i.MenuLevel).HasColumnName("MenuLevel");
            this.Property(i => i.MenuParentName).HasColumnName("MenuParentName");
            
        }   
    }
    
     public static class AdminMenuMapExtensions
    {
        public static void UserAdminMenuMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new AdminMenuMap());
        }
    }
}